package fr.jhaccoun.demenager_eco.web.module;

import org.apache.tiles.AttributeContext;
import org.apache.tiles.context.TilesRequestContext;
import org.apache.tiles.preparer.ViewPreparerSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import fr.jhaccoun.demenager_eco.utilisateur.UtilisateurService;
import fr.jhaccoun.demenager_eco.web.constants.Constants;
 

@Component
public class NavigationPreparer extends ViewPreparerSupport {

	@Autowired
	private UtilisateurService utilisateurService;
	
	@Override
	public void execute(TilesRequestContext tilesContext,
			AttributeContext attributeContext) {
		  
		tilesContext.getRequestScope().put(Constants.IS_LOGGED_ACCOUNT_KEY_NAME,utilisateurService.isLogged()); 
	}
	
	
}
